package dominio;

import java.io.Serializable;


import javax.persistence.Embedded;
import javax.persistence.Entity;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;


@Entity
@Table(name="clientes")

@NamedQueries({@NamedQuery(name="imprimir cliente", query="select cli from Cliente cli where cli.idCliente=:id"),
	
@NamedQuery(name="coincideIdRz",query="select cli.idCliente, cli.razonSocial from Cliente cli where cli.idCliente=:id and cli.razonSocial=:rz")})


	

public class Cliente implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Id @GeneratedValue(strategy=GenerationType.AUTO)
	private String idCliente;
	
	@Column(name="razonsocial",nullable=true)
	private String razonSocial;   //en caso de ser una sola persona representa el nombre
	
	@Embedded
	private Domicilio domicilio;
	
	@Column(name="telefono",nullable=true)
	private String telefono;
	
	@Column(name="cuil",nullable=true)
	private String cuil;
	
	private CondicionDeVenta condVenta;
	
	
	
	public String getCuil() {
		return cuil;
	}
	public void setCuil(String cuil) {
		this.cuil = cuil;
	}
	public CondicionDeVenta getCondVenta() {
		return condVenta;
	}
	public void setCondVenta(CondicionDeVenta condVenta) {
		this.condVenta = condVenta;
	}
	
	
	public String getIdCliente() {
		return idCliente;
	}
	public void setIdCliente(String idCliente) {
		this.idCliente = idCliente;
	}
	public String getRazonSocial() {
		return razonSocial;
	}
	public void setRazonSocial(String razonSocial) {
		this.razonSocial = razonSocial;
	}
	public Domicilio getDomicilio() {
		return domicilio;
	}
	public void setDomicilio(Domicilio domicilio) {
		this.domicilio = domicilio;
	}
	public String getTelefono() {
		return telefono;
	}
	public void setTelefono(String telefono) {
		this.telefono = telefono;
	}
	@Override
	public String toString() {
		return "Cliente [idCliente=" + idCliente + ", razonSocial="
				+ razonSocial + ", domicilio=" + domicilio + ", telefono="
				+ telefono + "]";
	}
	
	

}
